class CreateTerms < ActiveRecord::Migration
  def self.up
    create_table :terms do |t|
      t.references :time_unit
      t.integer :duration, :default => 1
      t.text :name

      t.timestamps
    end

    add_index(:terms, :name, :unique => true)
  end

  def self.down
    remove_index(:terms, :column => :name)
    drop_table :terms
  end
end
